COMPONENT=src/EnergyMeasurementC

CFLAGS += -Isrc
#CFLAGS += -I${TOSEXTDIR}/types
CFLAGS += -I../lib/energy
# uncomment these two lines to use the printf debugging tool
#CFLAGS += -I${TOSDIR}/lib/printf
#CFLAGS += -DPRINTF


BUILD_EXTRA_DEPS += java-files
CLEAN_EXTRA = simbuild build doc app.xml 
#java/src/energy/DataMessage.java java/src/energy/CommandMessage.java java/src/energy/Constants.java

java-files: $(wildcard *.java) Constants.java src/EnergyMeasurement.h 
#DataMessage.java CommandMessage.java
#	javac java/*.java

DataMessage.java:
	mig java -target=null $(CFLAGS) -java-classname=energy.DataMessage src/EnergyMeasurement.h energy_data_msg -o ../EnergyMeasurementJava/src/energy/$@

CommandMessage.java:
	mig java -target=null $(CFLAGS) -java-classname=energy.CommandMessage src/EnergyMeasurement.h energy_command_msg -o ../java/src/energy/$@

Constants.java:
	ncg -target=$(PLATFORM) $(CFLAGS) -java-classname=energy.Constants java src/EnergyMeasurementC.nc EnergyMeasurement.h -o ../java/src/energy/$@


include $(MAKERULES)